﻿using System;
using System.Diagnostics.Contracts;

namespace OpenCube.Nbt.Mapping
{
	[ContractClass(typeof(NbtMapperContract))]
	public interface INbtMapper
	{
		INbtDictionary MapToDictionary(object model);
		object MapToModel(INbtDictionary nbtDictionary);
	}

	[ContractClassFor(typeof(INbtMapper))]
	abstract class NbtMapperContract
		: INbtMapper
	{
		public INbtDictionary MapToDictionary(object model)
		{
			Contract.Ensures(Contract.Result<INbtDictionary>() != null);
			throw new NotImplementedException();
		}

		public object MapToModel(INbtDictionary nbtDictionary)
		{
			Contract.Requires<ArgumentNullException>(nbtDictionary != null);
			throw new NotImplementedException();
		}
	}

}